#pragma once
#include <string>
#include "IOrderService.h"
#include "KingdomDef.h"
#include "KCBPCli.h"

namespace tradeadapter
{
	namespace kingdom
	{


		class CKingdomSession
		{
		public:
			CKingdomSession(KCBPCLIHANDLE handler,const KingdomParamA& param);
			virtual ~CKingdomSession(void);

			bool SetFieldValue( const char* key, const char* val );

			bool SetFieldValue( const char* key, const std::string& val );

			bool SetFieldValue( const char* key, char val );

			bool SetFieldValue( const char* key, int val );			

			bool SetFieldValue( const char* key, double val );

#pragma warning(disable : 4482)
			bool SetBasicInfo(UseType ty  = UseType::Cust);
			


			std::string GetFieldValue(const char* key);


			bool GetStatusResult(std::pair<int,tstring>* pErr);


			bool _getRowDatas(EXDataSet* ret);


			bool GetDataResultS(EXDataSetS* res);

			bool BeginJob();
			bool CommitJob(const char* funcid);
		private:
			KCBPCLIHANDLE m_hHandle;
			KingdomParamA m_param;

			static std::string GetIP();
			static std::string GetHDID();
			static std::string GetCPUID();
			static std::string GetMac();
		};

	};
};